import React from 'react'
import { withRouter } from 'react-router-dom'
import { $pre } from "../../../../http/http"
import "./seckill.less"

const seckill= function seckill(props) {
    let { seckill } = props
    return (
        <div className='seckill'>
            <h2 style={{ fontSize: "0.3rem" }}>秒杀</h2>
            {
                seckill.map(item => {
                    return <div key={item.id} className="item" onClick={() => { props.history.push("/detail/" + item.id) }}>
                        <div style={{ color: "#fff", textAlign: "center" }}>{item.goodsname}</div>
                        <img src={$pre + item.img} alt="" />
                        <div className='foot'>
                            <div className='jiage'>
                                <p className='price'>{"¥" + item.price}</p>
                                <p className='market_price'>{"¥" + item.market_price}</p>
                            </div>
                            <div className='icon'>
                                <i className='iconfont icon-gouwucheman'></i>
                            </div>
                        </div>
                    </div>
                })
            }
        </div>
    )
}

export default withRouter(seckill);
